#ifndef GAMECONFIGMANAGER_H
#define GAMECONFIGMANAGER_H

#include <string>

#include "InputController.h"

class GameConfigManager
{
	public:
		GameConfigManager();

		bool LoadFromFile( const std::string& filename = "game.config" );
		bool SaveToFile  ( const std::string& filename = "game.config" ) const;


		float GetSoundVolume() const;
		void  SetSoundVolume( float theVolume );

		float GetMusicVolume() const;
		void  SetMusicVolume( float theVolume );

		bool GetParticlesEnabled() const;
		void SetParticlesEnabled( bool theParticlesEnabled );


		std::string GetJumpKey() const;
		void        SetJumpKey( const std::string& theKey );

		std::string GetWalkLeftKey() const;
		void        SetWalkLeftKey( const std::string& theKey );

		std::string GetWalkRightKey() const;
		void        SetWalkRightKey( const std::string& theKey );

		std::string GetCrouchKey() const;
		void        SetCrouchKey( const std::string& theKey );


		std::string GetSelectionUpKey() const;
		void        SetSelectionUpKey( const std::string& theKey );

		std::string GetSelectionLeftKey() const;
		void        SetSelectionLeftKey( const std::string& theKey );

		std::string GetSelectionRightKey() const;
		void        SetSelectionRightKey( const std::string& theKey );

		std::string GetSelectionDownKey() const;
		void        SetSelectionDownKey( const std::string& theKey );


		std::string GetRunKey() const;
		void        SetRunKey( const std::string& theKey );


		std::string GetPauseKey() const;
		void        SetPauseKey( const std::string& theKey );


		std::string GetLookUpKey() const;
		void        SetLookUpKey( const std::string& theKey );

		std::string GetLookLeftKey() const;
		void        SetLookLeftKey( const std::string& theKey );

		std::string GetLookRightKey() const;
		void        SetLookRightKey( const std::string& theKey );

		std::string GetLookDownKey() const;
		void        SetLookDownKey( const std::string& theKey );

		InputController GetInputController() const;

	protected:
		float soundVolume;
		float musicVolume;
		bool particlesEnabled;

		std::string jumpKey;
		std::string walkLeftKey;
		std::string walkRightKey;
		std::string crouchKey;

		std::string selectionUpKey;
		std::string selectionLeftKey;
		std::string selectionRightKey;
		std::string selectionDownKey;

		std::string runKey;

		std::string pauseKey;

		std::string lookUpKey;
		std::string lookLeftKey;
		std::string lookRightKey;
		std::string lookDownKey;

		bool IsOptionValid( const std::string& optionName ) const;
		bool IsKeyValid( const std::string& keyName ) const;

		gdn::Key::Code ConvertToInputController( const std::string& keyName ) const;
};

#endif // GAMECONFIGMANAGER_H
